﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using WisDom.SmartTMS.Interface;

namespace WisDom.SmartTMS.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class UserController : ControllerBase
    {
        //依赖注入
        private readonly IUserService _appService;

        public UserController(IUserService appService)
        {
            _appService = appService;
        }

        /// <summary>
        /// 测试接口显示
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<IActionResult> UserDtoLogin(string username, string password)
        {
            var user = await _appService.Get(username, password);
            return Ok(new { data = user, code = 200 });
        }
    }
}
